<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>电影详情页面</title>
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="container">
    <div class="text" style=" text-align:center;"><h1>电影详情页面</h1></div>
    <a class="btn btn-primary" th:href="@{/role/add/{movieId}(movieId = ${info.id})}">新增角色</a>
    <div class="row">
        <div class="col">
            <label>电影名称：</label>
            <span th:text="${info.name}"></span>
        </div>
        <div class="col">
            <label> 发行日期：</label>
            <span th:text="${info.createDate} ? ${#dates.format(info.createDate,'yyyy-MM-dd')} :''"></span>
        </div>
    </div>
    <h4>演员表</h4>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>#</th>
            <th>角色</th>
            <th>演员</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="role,roleStat : ${info.roles}">
            <td th:text="${roleStat.index + 1}"></td>
            <td th:text="${role.name}"></td>
            <td th:text="${role.actor.name}"></td>
            <td>
                <a th:href="@{/role/select/{roleId}(roleId=${role.id})}">查询演员个人信息</a>
                <a th:href="@{/role/edit/{roleId}(roleId=${role.id})}">编辑</a>.
                <a th:href="@{/role/delete/{roleId}(roleId=${role.id})}">删除</a>


            </td>
        </tr>
        </tbody>

    </table>
</div>
</body>
</html>